package com.clf.bms.webapp.controller;

import com.clf.bms.biz.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class TestController {


    @Autowired
    private TestService testService;

    //@Autowired
    //private Cache cache;

    //@Autowired
    //private RedisOperator redisOperator;


    @RequestMapping("/index")
    public String borrowList(String msg) {

        int max = Math.max(Runtime.getRuntime().availableProcessors(), 2);
        System.out.println(max);
        return testService.get(null);
    }

    /*@RequestMapping("/cache/get")
    public String get() {

        Optional<String> cache = this.redisOperator.get("cache");

        if (!cache.isPresent()) {
            return "null";
        }

        return cache.get();
    }

    @RequestMapping("/cache/set")
    public String set(String msg) {

        redisOperator.set("cache", msg);

        return "success";
    }*/

}
